package wei.xinya.core.edu;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTest {
    public static void main(String[] args) {
        SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
        String time = "2018-08-16";
        System.out.println(time + " Parses as ");
        Date t;
        try {
            t = ft.parse(time);
            System.out.println(t);
        } catch (ParseException e) {
            System.out.println("error using " + ft);
        }
    }
}
